package cn.wolfcode.trip.base.mapper;

import cn.wolfcode.trip.base.domain.User;
import cn.wolfcode.trip.base.query.DynamicLikeUsersQueryObject;
import cn.wolfcode.trip.base.query.DynamicQueryObject;
import cn.wolfcode.trip.base.query.QueryObject;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.ModelAttribute;

import java.util.List;
import java.util.Set;

public interface UserMapper {
    int deleteByPrimaryKey(Long id);

    int insert(User record);

    User selectByPrimaryKey(Long id);

    List<User> selectAll();

    int updateByPrimaryKey(User record);

    User selectByEmailAndPassword(@Param("email") String email, @Param("password") String password);

    List<User> selectForList(QueryObject qo);

    int getFansCount(Long userId);

    int getFocusCount(Long fansId);

    int judge(@Param("beVisitedId") Long beVisitedId, @Param("currentId") Long currentId);

    int addFocus(@Param("beVisitedId") Long beVisitedId, @Param("currentId") Long currentId);

    int deleteFocus(@Param("beVisitedId") Long beVisitedId, @Param("currentId") Long currentId);


    void deleteTravelLikeRelationByUserId(@Param("userId") Long userId, @Param("articleId") Long articleId);

    void insertTravelLikeRelationByUserId(@Param("userId") Long userId, @Param("articleId") Long articleId);

    void deleteStrategyLikeRelationByUserId(@Param("userId") Long userId, @Param("articleId") Long articleId);

    void deleteDailyLikeRelationByUserId(@Param("userId") Long userId, @Param("articleId") Long articleId);

    void insertStrategyLikeRelationByUserId(@Param("userId") Long userId, @Param("articleId") Long articleId);

    void insertDailyLikeRelationByUserId(@Param("userId") Long userId, @Param("articleId") Long articleId);

    void deleteStrategyDailyLikeRelationByUserId(@Param("userId") Long userId, @Param("articleId") Long articleId);

    void insertStrategyDailyLikeRelationByUserId(@Param("userId") Long userId, @Param("articleId") Long articleId);

    User checkPassword(@Param("password") String password, @Param("uid")Long uid);
    //查询聊天用户
    List<User> selectForChatSet(@Param("ids") Set<Long> set1);
    //查询关注人的id集合
    List<Long> queryFocusIdList(DynamicQueryObject qo);

    List<User> selectForLikeDynamicUsers(DynamicLikeUsersQueryObject qo);
    //查询是否点赞了朋友圈
    int queryDynamicIsLike(@Param("userId") Long userId, @Param("dynamicId") Long dynamicId);
    //点赞朋友圈
    void likeDynamic(@Param("userId") Long userId, @Param("dynamicId") Long dynamicId);
    //取消点赞朋友圈
    void cancelLikeDynamic(@Param("userId") Long userId, @Param("dynamicId") Long dynamicId);

    List<User> ListForFocus(QueryObject qo);

    List<User> ListForFans(QueryObject qo);
}